package com.cgy.utils.spider.template;

import lombok.Getter;
import lombok.Setter;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import java.util.List;

/**
 * 模版
 * @author CHTK
 */
@Getter
@Setter
@XmlRootElement
public class Template {

    @XmlElement(name = "field")
    private List<Field> fields;

    @XmlAttribute
    private String url;

    @XmlAttribute
    private String deepRegex;

    @XmlAttribute
    private String thread;

    public List<Field> getFields() {
        return fields;
    }
    @XmlTransient
    public void setFields(List<Field> fields) {
        this.fields = fields;
    }

    public String getUrl() {
        return url;
    }

    @XmlTransient
    public void setUrl(String url) {
        this.url = url;
    }

    public String getThread() {
        return thread;
    }

    @XmlTransient
    public void setThread(String thread) {
        this.thread = thread;
    }

    public String getDeepRegex() {
        return deepRegex;
    }
    @XmlTransient
    public void setDeepRegex(String deepRegex) {
        this.deepRegex = deepRegex;
    }
}
